<?php
/***
//自我游订单取消通知(已退款通知)
***/
// include('/var/www/html/new/d/module/api/ZiWoYou/ziwoyou.class.php');
// $zwy = new ZiWoYou();
include('/var/www/html/new/d/module/api/function.class.php');
if (!class_exists("go_sql")){
	include("/var/www/html/new/conf/le.je");
	$le=new go_sql();
	$le->connect();
}

$inSide = new SoapClient(null,array(
        "location" => "http://localhost/open/openService/pft_insideMX.php",
        "uri" => "www.16u.com?ac_16u=16ucom|pw_16u=c33367701511b4f6020ec61ded352059|auth_16u=true")
);
$PFT_infunction = new AllFunction(); 
$PFT_infunction->logfile('5|'.json_encode($_REQUEST),'refund_data');

$order_id = $_REQUEST['order_id'];
$cancel_num = $_REQUEST['cancel_num'];

if($order_id){
	$sel = "select * from all_api_order where apiOrder='$order_id' limit 1";
	$GLOBALS['le']->query($sel);
	if($GLOBALS['le']->fetch_assoc()){
		$pftOrder = $GLOBALS['le']->f('pftOrder');  
		$oStatus = $GLOBALS['le']->f('oStatus');  		
		if($pftOrder && ($oStatus==3 || $oStatus == 4)){
			$response = <<<xml
			<root>
				<result>true</result>
				<msg>接收成功</msg>
			</root>
xml;
			echo $response;
			exit;		
		}
		else{
			$response = <<<xml
				<root>
					<result>false</result>
					<msg>订单状态不是未使用</msg>
				</root>
xml;
			echo $response;
			exit;
		}
	}
	else{
		$response = <<<xml
			<root>
				<result>false</result>
				<msg>无此订单</msg>
			</root>
xml;
		echo $response;
		exit;
	}
}else{
	$response = <<<xml
			<root>
				<result>false</result>
				<msg>请输入有效数据</msg>
			</root>
xml;
	echo $response;
	exit;
}
?>